package com.example.jimanguang.Entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "rrewardComic")
@Getter
@Setter
public class RewardComic extends BaseEntity{
    public static final int TYPE_UNREWARD=0;
    public static final int TYPE_REWARD=1;

    private int  reward_status;
    @Temporal(TemporalType.TIMESTAMP)//确保实体类中的属性类型与数据库中的时间属性类型相匹配
    private Date reward_time;//打赏时间
    private int money;

    public RewardComic() {
        this.reward_time =new Date();
    }

    @ManyToOne
    private User user;
    @OneToOne
    private Comics comics;

    @JsonBackReference
    public User getUser(){return user;}



}
